import request from '@/config/axios'

// 知识关系点 VO
export interface KnowledgePointRelationVO {
  id: number // 主键
  entityId: number // 实体ID
  entityType: string // 实体类型
  pointId: number // 知识点ID
  creatorName: string // 创建人
  updaterName: string // 更新人
  version: number // 版本号
}

// 知识关系点 API
export const KnowledgePointRelationApi = {
  // 查询知识关系点分页
  getKnowledgePointRelationPage: async (params: any) => {
    return await request.get({ url: `/common/knowledge-point-relation/page`, params })
  },

  // 查询知识关系点详情
  getKnowledgePointRelation: async (id: number) => {
    return await request.get({ url: `/common/knowledge-point-relation/get?id=` + id })
  },

  // 新增知识关系点
  createKnowledgePointRelation: async (data: KnowledgePointRelationVO) => {
    return await request.post({ url: `/common/knowledge-point-relation/create`, data })
  },

  // 修改知识关系点
  updateKnowledgePointRelation: async (data: KnowledgePointRelationVO) => {
    return await request.put({ url: `/common/knowledge-point-relation/update`, data })
  },

  // 删除知识关系点
  deleteKnowledgePointRelation: async (id: number) => {
    return await request.delete({ url: `/common/knowledge-point-relation/delete?id=` + id })
  },

  // 导出知识关系点 Excel
  exportKnowledgePointRelation: async (params) => {
    return await request.download({ url: `/common/knowledge-point-relation/export-excel`, params })
  },
}